package org.xawl.news.entity.user;

import java.io.Serializable;
import java.util.Date;

import org.xawl.news.entity.role.Role;

public class User implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键，id
	 */
	private int id;

	/**
	 * 用户密码
	 */
	private String password;

	/**
	 * 用户名
	 */
	private String username;

	/**
	 * 性别
	 */
	private int gender;

	/**
	 * 专业
	 */
	private String major;

	/**
	 * 班级
	 */
	private String classes;

	/**
	 * 年级
	 */
	private String grade;

	/**
	 * 电话号码
	 */
	private String mobile;

	/**
	 * 常用邮箱
	 */
	private String email;

	/**
	 * 是否启用。0:启用, 1禁用
	 */
	private int isEnabled;
	
	/**
	 * 角色ID
	 */
	private int roleId;
	
	private Role role;

	/**
	 * 最后登录时间
	 */
	private Date lastTime;

	/**
	 * 创建时间
	 */
	private Date createTime;

	/**
	 * 更新时间
	 */
	private Date updateTime;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public int getGender() {
		return gender;
	}

	public void setGender(int gender) {
		this.gender = gender;
	}

	public String getClasses() {
		return classes;
	}

	public String getMajor() {
		return major;
	}

	public void setMajor(String major) {
		this.major = major;
	}

	public void setClasses(String classes) {
		this.classes = classes;
	}

	public String getGrade() {
		return grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getIsEnabled() {
		return isEnabled;
	}
	
	public int getRoleId() {
		return roleId;
	}

	public void setRoleId(int roleId) {
		this.roleId = roleId;
	}

	public void setIsEnabled(int isEnabled) {
		this.isEnabled = isEnabled;
	}

	public Date getLastTime() {
		return lastTime;
	}

	public void setLastTime(Date lastTime) {
		this.lastTime = lastTime;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", password=" + password + ", username="
				+ username + ", gender=" + gender + ", major=" + major
				+ ", classes=" + classes + ", grade=" + grade + ", mobile="
				+ mobile + ", email=" + email + ", isEnabled=" + isEnabled
				+ ", roleId=" + roleId + ", lastTime=" + lastTime
				+ ", createTime=" + createTime + ", updateTime=" + updateTime
				+ "]";
	}
}
